#!/bin/bash

echo "Post Install/Upgrade Script"
echo "Using cache folder: $INSTALLER_TEMP"

echo "Install FNPLicensingService 11.6.0"
cd "$1/Contents/Resources/TrustedStore"
"./install_fnp.sh" 
RESULT1="$?"
 
# Check if the script returns an error-code
if [ $RESULT1 != 0 ]; then exit 1; fi

echo "Install FNPLicensingService 11.5.0"
cd "$1/Contents/Resources/TrustedStore11.5.0"
"./install_fnp.sh" 
RESULT1="$?"
 
# Check if the script returns an error-code
if [ $RESULT1 != 0 ]; then exit 1; fi

echo "Initialize Trusted Store"
cd "$1/Contents/Resources/ActivationTool"
"./loctstool" -act -asr TSInitializer.asr
RESULT2="$?"

# Check if the script returns an error-code
# if [ $RESULT2 != 0 ]; then exit 1; fi

exit 0
